import request from '@/utils/request'
import qs from 'qs'

/**
 * 差旅费申请
 * 查询员工
 * 入参名称：username
 */
export function getUserInfoList(code) {
  return request({
    url: '/api/admin/user/getUserInfoList?' + qs.stringify(code),
    method: 'get'
  })
}

/**
 * 差旅费申请
  POST /applyProjectTravelling/apply 提交申请
 */
export function apply(list) {
  return request({
    url: '/api/admin/applyProjectTravelling/apply',
    method: 'post',
    data: list
  })
}

/**
 * 差旅费申请
  POST /applyProjectTravelling/save 保存草稿
 */

export function save(list) {
  return request({
    url: '/api/admin/applyProjectTravelling/save',
    method: 'post',
    data: list
  })
}

/**
 * 差旅费申请
 Get /applyProjectTravelling/save 保存草稿
 */

export function copyApplyToDraft(list) {
  return request({
    url: '/api/admin/applyProjectTravelling/copyApplyToDraft',
    method: 'get',
    params: list
  })
}

/**
 * 差旅费申请
  POST /applyProjectTravelling/selectList 查询列表
 */

export function selectList(list) {
  return request({
    url: '/api/admin/applyProjectTravelling/selectList?' + qs.stringify(list),
    method: 'get'
  })
}

/**
 * 差旅费申请  草稿箱
 * GET /applyProjectTravelling/page 分页获取数据
 */
export function selectById(list) {
  return request({
    url: '/api/admin/applyProjectTravelling/selectById?' + qs.stringify(list),
    method: 'get'
  })
}

/**
 * 差旅费申请  我的申请
 * GET /applyProjectTravelling/page 分页获取数据
 */
export function selectByApplyId(list) {
  return request({
    url: '/api/admin/applyProjectTravelling/selectByApplyId?' + qs.stringify(list),
    method: 'get'
  })
}

/**
 * 差旅费申请
 * GET GET /applyProjectTravelling/delete  批量删除
 */
export function travelDelete(list) {
  return request({
    url: '/api/admin/applyProjectTravelling/delete',
    method: 'post',
    data: list
  })
}

/**
 * 差旅费申请
 * GET GET 导出
 */
export function exportApplyTravel(list) {
  return request({
    url: '/api/admin/excel/exportApplyTravel?' + qs.stringify(list),
    method: 'get'
  })
}
